// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov  Date: 2007-9-15 18:54:31

// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   v4.java

package com.zelix;

import java.io.IOException;
import java.io.Reader;

// Referenced classes of package com.zelix:
//            bf, vh, lx, gs

public class v4 {

    static int a;
    static int b;
    static int c;
    public static int d;
    protected static int e[];
    protected static int f[];
    protected static int g;
    protected static int h;
    protected static boolean i;
    protected static boolean j;
    protected static Reader k;
    protected static char l[];
    protected static int m;
    protected static int n;
    private static String z;

    public v4(Reader reader, int i1, int j1) {
        this(reader, i1, j1, 4096);
    }

    public v4(Reader reader, int i1, int j1, int k1) {
        if (k != null) {
            throw new Error(z);
        } else {
            k = reader;
            h = i1;
            g = j1 - 1;
            b = a = k1;
            l = new char[k1];
            e = new int[k1];
            f = new int[k1];
            return;
        }
    }

    public static char a()
            throws IOException {
        c = -1;
        char c1 = h();
        c = d;
        return c1;
    }

    protected static void a(boolean flag) {
        int i1;
        boolean flag1;
        label0:
        {
            flag1 = lx.j;
            i1 = bf.d;
            char ac[] = new char[a + 2048];
            int ai[] = new int[a + 2048];
            int ai1[] = new int[a + 2048];
            try {
                if (flag) {
                    System.arraycopy(l, c, ac, 0, a - c);
                    System.arraycopy(l, 0, ac, a - c, d);
                    l = ac;
                    System.arraycopy(e, c, ai, 0, a - c);
                    System.arraycopy(e, 0, ai, a - c, d);
                    e = ai;
                    System.arraycopy(f, c, ai1, 0, a - c);
                    System.arraycopy(f, 0, ai1, a - c, d);
                    f = ai1;
                    m = d += a - c;
                    if (i1 == 0)
                        break label0;
                }
                System.arraycopy(l, c, ac, 0, a - c);
                l = ac;
                System.arraycopy(e, c, ai, 0, a - c);
                e = ai;
                System.arraycopy(f, c, ai1, 0, a - c);
                f = ai1;
                m = d -= c;
            }
            catch (Throwable throwable) {
                throw new Error(throwable.getMessage());
            }
        }
        a += 2048;
        b = a;
        c = 0;
        if (vh.e != 0)
            bf.d = ++i1;
        if (gs.b != 0)
            lx.j = !flag1;
    }

    protected static void b()
            throws IOException {
        label0:
        {
            int j1 = bf.d;
            if (m != b)
                break label0;
            if (b == a) {
                if (c > 2048) {
                    d = m = 0;
                    b = c;
                    if (j1 == 0)
                        break label0;
                }
                if (c < 0) {
                    d = m = 0;
                    if (j1 == 0)
                        break label0;
                }
                a(false);
                if (j1 == 0)
                    break label0;
            }
            if (b > c) {
                b = a;
                if (j1 == 0)
                    break label0;
            }
            if (c - b < 2048) {
                a(true);
                if (j1 == 0)
                    break label0;
            }
            b = c;
        }
        int i1;
        try {
            if ((i1 = k.read(l, m, b - m)) == -1) {
                k.close();
                throw new IOException();
            } else {
                m += i1;
                return;
            }
        }
        catch (IOException ioexception) {
            d--;
            b(0);
            if (c == -1)
                c = d;
            throw ioexception;
        }
    }

    public static String c() {
        if (d >= c)
            return new String(l, c, (d - c) + 1);
        else
            return new String(l, c, a - c) + new String(l, 0, d + 1);
    }

    public static char[] a(int i1) {
        char ac[];
        label0:
        {
            ac = new char[i1];
            if (d + 1 >= i1) {
                System.arraycopy(l, (d - i1) + 1, ac, 0, i1);
                if (bf.d == 0)
                    break label0;
            }
            System.arraycopy(l, a - (i1 - d - 1), ac, 0, i1 - d - 1);
            System.arraycopy(l, 0, ac, i1 - d - 1, d + 1);
        }
        return ac;
    }

    public void a(Reader reader, int i1, int j1) {
        a(reader, i1, j1, 4096);
    }

    public void a(Reader reader, int i1, int j1, int k1) {
        k = reader;
        h = i1;
        g = j1 - 1;
        if (l == null || k1 != l.length) {
            b = a = k1;
            l = new char[k1];
            e = new int[k1];
            f = new int[k1];
        }
        j = i = false;
        c = n = m = 0;
        d = -1;
    }

    protected static void a(char c1) {
        int i1;
        label0:
        {
            i1 = bf.d;
            g++;
            if (j) {
                j = false;
                h += g = 1;
                if (i1 == 0)
                    break label0;
            }
            if (!i)
                break label0;
            i = false;
            if (c1 == '\n') {
                j = true;
                if (i1 == 0)
                    break label0;
            }
            h += g = 1;
        }
        switch (c1) {
            case 11: // '\013'
            case 12: // '\f'
            default:
                break;

            case 13: // '\r'
                i = true;
                if (i1 == 0)
                    break;
                // fall through

            case 10: // '\n'
                j = true;
                if (i1 == 0)
                    break;
                // fall through

            case 9: // '\t'
                g--;
                g += 8 - (g & 7);
                break;
        }
        e[d] = h;
        f[d] = g;
    }

    public static void b(int i1) {
        n += i1;
        if ((d -= i1) < 0)
            d += a;
    }

    public static int d() {
        return f[c];
    }

    public static int e() {
        return e[c];
    }

    public static int f() {
        return f[d];
    }

    public static int g() {
        return e[d];
    }

    public static char h()
            throws IOException {
        if (n > 0) {
            n--;
            if (++d == a)
                d = 0;
            return l[d];
        }
        if (++d >= m)
            b();
        char c1 = l[d];
        a(c1);
        return c1;
    }

    private static String z(char[] chs) {
        for (int i = 0; i < chs.length; i++) {
            byte key = 0;
            switch (i % 5) {
                case 0:
                    key = 0x1d;
                    break;
                case 1:
                    key = 38;
                    break;
                case 2:
                    key = 32;
                    break;
                case 3:
                    key = 94;
                    break;
                default:
                    key = 127;
                    break;
            }
            chs[i] ^= key;
        }
        return new String(chs).intern();
    }

    static {
        z = z("\027\006\000~:Oto\fE=uE=\020sB\000=\036qJ\000*\020=RH;_~IN-\013oSC*\020o\006O8_|\006S*\036iOC~,tKP2\032^NA,,iTE?\0223\006\000\007\020h\006M+\fi,\000~_=\006\000~\032tRH;\r=SS;_OCi0\026i\016\t~\020o\006S;\013=RH;_WGV?<^\006O.\013tIN~,Igt\027<=RO~\031|JS;u=\006\000~_=\006D+\rtHG~\013uC\0009\032sCR?\013tIN~\020{\006T6\026n\006C2\036nU\016".toCharArray());
        d = -1;
        g = 0;
        h = 1;
        i = false;
        j = false;
        m = 0;
        n = 0;
    }
}